#ifndef PERSISTMAIN_H
#define PERSISTMAIN_H

#include <QMainWindow>
#include <QSqlDatabase>
#include <QSqlTableModel>

namespace Ui {
    class PersistMain;
}

class PersistMain : public QMainWindow {
    Q_OBJECT
public:
    PersistMain(QWidget *parent = 0);
    ~PersistMain();

protected:
    void changeEvent(QEvent *e);

private:
    Ui::PersistMain *ui;
    QSqlTableModel *dbModel;
    QSqlDatabase db;
    void setupDatabase(QString name);

private slots:
    void on_actionChart_triggered();
    void on_actionDelete_triggered();
    void on_actionEdit_triggered();
    void on_actionAdd_triggered();
    void rightButtonClicked(const QPoint &p);
};

#endif // PERSISTMAIN_H
